package com.gupao.edu.study.singleton;

import java.io.Serializable;

/**
 * @Author: guqy
 * @Description:序列化单例,反序列化时会使单例被破坏
 * @Date 11:43 2018/3/19
 */
public class SeriableSingleton implements Serializable{
    public final static SeriableSingleton bean = new SeriableSingleton();
    private SeriableSingleton(){}
    public static SeriableSingleton getBean(){
        return bean;
    }
    private Object readResolve(){return bean;}
}
